const BASE_URL = 'http://localhost:8080/api/v1';
const token = localStorage.getItem('bigEvents');

let ajax = function (methods, url, param) {

    return new Promise(function (resolve, reject) {
        $.ajax({
            type: methods,
            url: BASE_URL + url,
            data: param,
            dataType: "json",
            headers: {
                Authorization: token
            },
            success: function (data) {
                resolve(data);
            },
            error: function (error) {
                reject(error)
            }
        });
    })
};